Skip to content

Change large card view to use full width#4110

Open
Nutomic wants to merge 5 commits into
mainfrom
card-full-width
Open

Change large card view to use full width#4110
Nutomic wants to merge 5 commits into
mainfrom
card-full-width

Conversation

@Nutomic
Copy link
Copy Markdown
Member

@Nutomic Nutomic commented May 19, 2026

This seems better to view full-size images on desktop, without separately expanding each image.

Screenshot_20260519_143024

@dessalines
Copy link
Copy Markdown
Member

Not a fan of this, especially for wide devices. Then you get stuff like this on really wide devices:

Screenshot_2026-05-19-11-12-48-656_com jerboa

If you want to increase the double column breakpoint from md to lg (or possibly xl tho, that might work.

@Nutomic
Copy link
Copy Markdown
Member Author

Nutomic commented May 25, 2026

You mean that images get cut off? Doesnt happen in my testing, it always shows the full image. Although theres a problem that tall images can take up the entire screen, possibly needs a max height.


Screenshot_20260525_125813 Screenshot_20260525_125826

Using col-xl-6 doesnt seem to work, even with a rather narrow browser window (1040px wide) it shows two columns.

@dessalines
Copy link
Copy Markdown
Member

Although theres a problem that tall images can take up the entire screen, possibly needs a max height.

Yes this is the case, and its why wider screens should be using the 2-column layout.

Using col-xl-6 doesnt seem to work, even with a rather narrow browser window (1040px wide) it shows two columns.

xl should be >1200 px wide: https://getbootstrap.com/docs/5.3/layout/breakpoints/#available-breakpoints

There's several places where this should be done I think, but I'll test it out.

@dessalines
Copy link
Copy Markdown
Member

I've verified that col-xl-6 works fine.

@Nutomic
Copy link
Copy Markdown
Member Author

Nutomic commented May 26, 2026

Ah making the browser window narrower does switch it to single column. But col-xl-6 still isnt so helpful, because the main content has a maximum width even on very large screens. So on wider browser window/bigger screen you actually get smaller images:

Screenshot_20260526_115842 Screenshot_20260526_115855

With the change in this PR you can see larger images also on big screens, and dont need to expand every single image:
Screenshot_20260526_120000

@dessalines
Copy link
Copy Markdown
Member

because the main content has a maximum width even on very large screens

That's an issue with the top level containers not something to be fixed with this PR.

The card view should not be ignoring the double columns, that's something that I want to keep.

@Nutomic
Copy link
Copy Markdown
Member Author

Nutomic commented May 28, 2026

The problem is that "Card" and "Small Card" modes are almost identical on large screens. While "Card" does show images a bit larger, its not large enough to view them properly, and so you still need to expand manually for every single image.

url.searchParams.set("max_size", bannerSize.toString());
break;
case "full_size":
break;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed a bug here, in large card mode it was always loading images downscaled to 512px because it was entering the default case here. Also added other variants where it seems to make sense.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm... not sure about this one. 512px seems plenty large enough, and we def want to downscale no matter, even for the card views, to save on initial page load bandwidth. These images could be 10MB or more, we don't know.

The only time we shouldn't be downscaling IMO, is for the full image viewer.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay changed the name to large_thumbnail and set it to 2048px.

case "card":
return "col-12";
case "small_card":
return "col-12 col-md-6";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just change this:

Suggested change
return "col-12 col-md-6";
return "col-12 col-xl-6";

The cards should still be doing a 2-column masonry layout, its what differentiates it from a list view.

url.searchParams.set("max_size", bannerSize.toString());
break;
case "full_size":
break;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm... not sure about this one. 512px seems plenty large enough, and we def want to downscale no matter, even for the card views, to save on initial page load bandwidth. These images could be 10MB or more, we don't know.

The only time we shouldn't be downscaling IMO, is for the full image viewer.

@dessalines
Copy link
Copy Markdown
Member

The problem is that "Card" and "Small Card" modes are almost identical on large screens. While "Card" does show images a bit larger, its not large enough to view them properly, and so you still need to expand manually for every single image.

I'm not really sure that's the case:

Screenshot_2026-05-28-14-07-42-273_org cromite cromite

This to me is plenty large enough for scrolling, and my screen isn't even that large.

@Nutomic
Copy link
Copy Markdown
Member Author

Nutomic commented May 29, 2026

Sure the text is still barely readable. But if you use Card view on mobile it shows images practically in fullscreen size. Then switch to desktop with the same mode and suddenly you only get medium-sized thumbnails.

In the Lemmy settings you can only specify a single Listing Mode which applies to all devices. So it should actually have similar functionality everywhere, otherwise you need to change Listing Mode all the time.

@dessalines
Copy link
Copy Markdown
Member

dessalines commented May 30, 2026

If ppl want an ultra-wide view, that's what list view mode is for. The card views should use a masonry layout (2 columns for xl screens and higher). This PR as it is undoes that.

In the future we could possibly make the number of columns configurable, but IMO that's a bad idea, because it should be done automatically by the current device screen size.

We should also probably even add 3 columns or more for xxl screens.

@Nutomic
Copy link
Copy Markdown
Member Author

Nutomic commented Jun 1, 2026

More columns makes no sense if the container has such a limited width. On large screen with browser in fullscreen, Lemmy only uses about half the available width.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants